<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="" content="">
  <title></title>
  <style></style>
</head>

<body>
  <p>ok</p>

  <script>
    function p (url){
      return new Promise(function (resolve, reject){

        $.ajax({
          url,
          dataType: 'json',
          success(arr){ resolve(arr) },
          error(err){ reject(err) }
        }) //ajax

      }) //Promise

    } //p

    Promise.all([p(url1), p(url2)]).then(
    function(arr){ 
      let [a, b] = arr
      console.log(a,b)
    },
    function(err){ console.log(err)}
    )
  
  </script>
</body>

</html>




